package com.rmy.queue.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import com.rmy.queue.domain.QmsMainBusiness;
import com.rmy.queue.domain.QmsMainCalledResp;
import com.rmy.queue.domain.QmsReportSummary;
import com.rmy.queue.domain.QmsWindowInfo;

/**
 * 预约管理Service接口
 *
 * @author rmy
 * @date 2022-09-29
 */
public interface IQmsMainBusinessService
{
    /**
     * 查询预约管理
     *
     * @param mbSerialNo 预约管理主键
     * @return 预约管理
     */
    public QmsMainBusiness selectQmsMainBusinessByMbSerialNo(String mbSerialNo);

    /**
     * 查询预约管理列表
     *
     * @param qmsMainBusiness 预约管理
     * @return 预约管理集合
     */
    public List<QmsMainBusiness> selectQmsMainBusinessList(QmsMainBusiness qmsMainBusiness);

    /**
     * 新增预约管理
     *
     * @param qmsMainBusiness 预约管理
     * @return 结果
     */
    public int insertQmsMainBusiness(QmsMainBusiness qmsMainBusiness);

    /**
     * 修改预约管理
     *
     * @param qmsMainBusiness 预约管理
     * @return 结果
     */
    public int updateQmsMainBusiness(QmsMainBusiness qmsMainBusiness);

    /**
     * 批量删除预约管理
     *
     * @param mbSerialNos 需要删除的预约管理主键集合
     * @return 结果
     */
    public int deleteQmsMainBusinessByMbSerialNos(String[] mbSerialNos);

    /**
     * 删除预约管理信息
     *
     * @param mbSerialNo 预约管理主键
     * @return 结果
     */
    public int deleteQmsMainBusinessByMbSerialNo(String mbSerialNo);

    /**
     * 取号
     *
     * @param qmsMainBusiness 预约登记
     * @return 结果
     */
    public int takeNumber(QmsMainBusiness qmsMainBusiness);

    /**
     * 根据ERP业务类型获取当前有效队列
     * @param qmsMainBusiness
     * @return
     */
    public List<QmsMainBusiness> selectBusinessQueueList(QmsMainBusiness qmsMainBusiness);


    /**
     * 获取已取号列表
     * @param qmsMainBusiness
     * @return
     */
    public List<QmsMainBusiness> selectBusinessQueueListTaked(QmsMainBusiness qmsMainBusiness);


    /**
     * 获取已叫号列表
     * @param qmsMainBusiness
     * @return
     */
    public List<QmsMainBusiness> selectBusinessQueueListCalled(QmsMainBusiness qmsMainBusiness);

    /**
     * 根据鹤位uuid查询当前队列列表
     * @param qmsMainBusiness
     * @return
     */
    public List<QmsMainBusiness> selectQueueListByUUID(QmsMainBusiness qmsMainBusiness) throws Exception;

    /**
     * 按机构发送
     * @param orgNo
     * @throws IOException
     */
    public void sendCompScreen(String orgNo) throws IOException;

    /**
     * 业务叫号
     * @param windowUuid
     * @return
     */
    public QmsMainBusiness callBusinessNumber(String windowUuid) throws Exception;

    /**
     * 业务重呼
     * @param windowUuid
     * @return
     */
    public QmsMainBusiness recallBusinessNumber(String windowUuid) throws Exception;

    /**
     * 跳过
     * @param windowUuid
     * @return
     */
    public QmsMainBusiness ignoreBusinessNumber(String windowUuid) throws Exception;

    /**
     * 指定呼叫
     *
     * @param windowUuid UUID
     * @return 结果
     */
    public QmsMainBusiness callByQueueNumber(String windowUuid, String queueNo) throws Exception;

    /**
     * 今日预约计数
     * @return
     */
    public String selectBookingCount(QmsMainBusiness qmsMainBusiness);

    /**
     * 一周预约count
     * @return
     */
    public List<Map<String, Object>> selectWeekBookingCount(QmsMainBusiness qmsMainBusiness);

    /**
     * 一周取号count
     * @return
     */
    public List<Map<String, Object>> selectWeekTakeNoCount(QmsMainBusiness qmsMainBusiness);

    /**
     * 一周进场count
     * @return
     */
    public List<Map<String, Object>> selectWeekEntryCount(QmsMainBusiness qmsMainBusiness);
    /**
     * 一周出场count
     * @return
     */
    public List<Map<String, Object>> selectWeekExitCount(QmsMainBusiness qmsMainBusiness);

    /**
     * 今日取号计数
     * @return
     */
    public String selectTakeNoCount(QmsMainBusiness qmsMainBusiness);


    /**
     * 当前等待叫号count
     * @return
     */
    public String selectWaitingCallCount(QmsMainBusiness qmsMainBusiness);

    /**
     * 正在叫号的count
     * @return
     */
    public String selectCallingCount(QmsMainBusiness qmsMainBusiness);

    /**
     * 今日进场的count
     * @return
     */
    public String selectEntryCount(QmsMainBusiness qmsMainBusiness);
    /**
     * 今日离场的count
     * @return
     */
    public String selectExitCount(QmsMainBusiness qmsMainBusiness);

    /**
     * 根据机构查询已叫号列表
     */
    public List<QmsMainCalledResp> selectMainCalledListByOrgNo(String orgNo);

    /**
     * 根据机构查询等待叫号列表
     */
    public List<QmsMainCalledResp> selectMainWaitCallByOrgNo(String orgNo);

    /**
     * 根据窗口UUID查询当前正在加号的信息
     * @param windowUuid
     * @return
     */
    public QmsMainBusiness selectCurCallQueueNo(String windowUuid);


    /**
     * 预约业务占比情况
     * @param qmsMainBusiness
     * @return
     */
    public List<Map<String, Object>> selectBookingBusinessCount(QmsMainBusiness qmsMainBusiness);

    /**
     * 统计汇总查询
     * @param qmsMainBusiness
     * @return
     */
    public List<QmsReportSummary> selectSummaryList(QmsMainBusiness qmsMainBusiness);

    /**
     * 根据机构统计汇总查询
     * @param qmsMainBusiness
     * @return
     */
    public List<QmsReportSummary> selectSummaryListByDept(QmsMainBusiness qmsMainBusiness);

    /**
     * 根据业务统计汇总查询
     * @param qmsMainBusiness
     * @return
     */
    public List<QmsReportSummary> selectSummaryListByBusiness(QmsMainBusiness qmsMainBusiness);

    /**
     * 根据结构查询鹤位信息列表
     * @param orgNo
     * @return
     */
    public List<QmsWindowInfo> selectWindowListByDept(String orgNo);

}
